package com.yundasys.lab04springbootlocalmsg.controller;

import com.yundasys.lab04springbootlocalmsg.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @PACKAGE_NAME: com.yundasys.lab04springbootlocalmsg.controller
 * @NAME: PaymentController
 * @USER: jiangta
 * @DATE: 2021/1/16
 * @TIME: 10:44 下午
 * @PROJECT_NAME: springboot-labs
 */
@RestController
public class PaymentController {

    @Autowired
    private PaymentService paymentService;

    @RequestMapping("/payment")
    public String payment(int userId, int orderId, BigDecimal amount) throws Exception {
        int i = paymentService.paymentMQ(userId, orderId, amount);
        return "支付结果:" + i;
    }
}
